define([ "esri/geometry/Point", "esri/SpatialReference", "util/map/toolbar/identifyTask", "util/map/geometry/point", "util/map/geometry/circle",],
	function( Point, SpatialReference, identifyTaskUtil, pointUtil, circle) {
	return {
		addInfoWindow : function(map, longitude, latitude, accuracy) {

		        var toX=longitude * 20037508.34 / 180;
		        var toY = convertWGS84ToMercator(latitude);
				var point = pointUtil.getPointByWechatLocal(longitude, latitude);
				var circleGeometry = circle.getCircleByPointAndRadius(point, accuracy);
				identifyTaskUtil.addInfoWindow(circleGeometry, map,toX, toY);
			}
		}
	});

convertWGS84ToMercator = function(lat) {
	var merY = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
	merY = merY * 20037508.34 / 180;
	return merY;
}